package com.example.design.observer.rate.subject;

import com.example.design.observer.rate.observer.Company;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description 汇率-抽象目标
 * @ClassName Rate
 * @Author Yumuhui
 * @Date 2020/5/16 0:24
 * @Version 1.0.0
 */
public abstract class Rate {

    public List<Company> observers = new ArrayList<>();

    public void addObserver(Company observer){
        observers.add(observer);
    }
    public void removeObserver(Company observer){
        observers.remove(observer);
    }

    public abstract void change(double rate);
}
